package com.itheima.mapper;

import com.itheima.pojo.CheckGroup;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealAndCheckGroup {
    @Insert("insert into t_setmeal_checkgroup(setmeal_id,checkgroup_id) values(#{setmealId},#{checkgroupId})")
    void addCheckItemAndCheckGroup(Integer setmealId, Integer checkgroupId);

    @Select("select checkgroup_id from t_setmeal_checkgroup where setmeal_id = #{id}")
    List<Integer> findCheckGroupsBySetmealId(Integer id);


    @Delete("delete from t_setmeal_checkgroup where setmeal_id = #{id}")
    void deleteBySetmealId(Integer id);
}
